// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_b.p_b.p_a;

import com.nnee.p_b.p_a.cls_d;
import com.nnee.p_b.p_b.p_e.cls_f;
import com.nnee.p_b.p_b.p_e.cls_g;
import com.nnee.p_b.p_b.p_e.cls_k;
import com.nnee.p_c.p_b.cls_b;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_pr.p_a.cls_i;
import com.nnee.p_pr.p_c.cls_l;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.nnee.b.b.a:
//            b

public class cls_a extends cls_k
{

    protected cls_a(int i1)
    {
        super(i1);
    }

    public static com.nnee.p_fk.p_b.cls_a a(String s, String s1, String s2)
    {
        cls_a a1 = new cls_a(4097);
        a1.a = s1;
        a1.b = s2;
        a1.j = s;
        return a1;
    }

    private void a(String s, String s1)
    {
        com.nnee.p_b.p_b.p_a.cls_b.a().a(s, s1);
    }

    private boolean a()
    {
        boolean flag = true;
        String as[] = cls_l.c(cls_d.h().a(), j, 5);
        if(as != null && as.length == 2 && !cls_i.e(as[0]) && !cls_i.e(as[1]))
            a(as[0], as[1]);
        else
            flag = false;
        return flag;
    }

    private cls_m b()
    {
        ArrayList arraylist;
        cls_m m1;
        String s = com.nnee.p_b.p_b.p_a.cls_b.a().a("");
        arraylist = new ArrayList();
        if(!cls_i.e(a))
            arraylist.add(new cls_b("status", a));
        if(!cls_i.e(b))
            arraylist.add(new cls_b("place_id", b));
        com.nnee.p_b.p_b.p_a.cls_b.a().a(arraylist, "status.set");
        m1 = new cls_m(s, com.nnee.p_fk.p_a.cls_b.bPOST);
        UrlEncodedFormEntity urlencodedformentity=null;
		try {
			urlencodedformentity = new UrlEncodedFormEntity(arraylist, "utf-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        m1.a(urlencodedformentity);
 
        return m1;
         
    }

    private Object b(String s)
    {
        Object obj;
        Object obj1;
        obj = null;
        obj1 = new cls_g(5);
        int i1=0;
		try {
			i1 = (new JSONObject(s)).optInt("result");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        if(i1 == 1){
        	 ((cls_g) (obj1)).a(String.valueOf(i1));
        	 
        	         if(obj1 == null || !cls_i.e(((cls_g) (obj1)).b()))
        	             obj = obj1;
        	} else {
        	obj = com.nnee.p_b.p_b.p_a.cls_b.a().b(s);
        }
        return obj;

    }

    public void a(int i1, String s)
    {
        cls_f f1 = com.nnee.p_b.p_b.p_a.cls_b.a().b(s);
        d(f1.h, f1);
    }

    public void a(String s)
    {Object obj = null;
        switch(n())
        {
      
        case 4097:
        	com.nnee.p_g.cls_b.e("BlogTransaction", s);
            obj = b(s);
        	break;
        case 4098:
        	 obj = b(s);
        	break;
        default:
        	break;
        }
        
        
        if(!o())
            if(obj != null)
            {
                if(obj instanceof cls_f)
                    d(((cls_f)obj).h, obj);
                else
                    c(0, obj);
            } else
            {
                d(-1, null);
            }
        return;
     
    }

    public void c()
    {
        if(a()) {
        	switch(n())
        	{
        	
        	case 4097:
        		k = b();
        		break;
default:
        		
        		break;
        	}
        	
        	if(k != null && !o())
            {
                a(k);
            } else
            {
                d(-4, null);
                h();
            }
    		
        	
        } else {
        	d(-2, null);
            com.nnee.p_g.cls_b.d("***********", "Error  withou token & secret to send blog");
            return;
        }
 
    }

    private String a;
    private String b;
    private String j;
    private cls_m k;
}
